import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

import * as echarts from 'echarts'
import '@/utils/tableformater'

// 引入RTCMS SDK
import tvvssdk from '@/sdk/tvvssdk'
Vue.prototype.$tvvssdk = tvvssdk

import vueFilter from '@/filters/filters'
for (const key in vueFilter) {
  Vue.filter(key, vueFilter[key])
}

const host = window.location.host
const hostname = window.location.hostname

Vue.prototype.$sdkOptions = {
  // websocketurl: 'wss://meeting.zwan.com.cn:2337/log', // websocket信令服务URL
  // oamurl: 'https://meeting.zwan.com.cn:2337', // 管理服务URL
  // stunurl: 'stun:stun.zwan.com.cn:2331' // stun服务器地址

  // websocketurl: 'wss://meeting.zwan.com.cn:2437/log', // websocket信令服务URL
  // oamurl: 'https://meeting.zwan.com.cn:2437', // 管理服务URL
  // stunurl: 'stun:stun.zwan.com.cn:2431' // stun服务器地址

  // websocketurl: 'wss://113.207.109.120:40004/log', // websocket信令服务URL
  // oamurl: 'https://113.207.109.120:40004', // 管理服务URL
  // stunurl: 'stun:113.207.109.120:40000' // stun服务器地址

  // websocketurl: 'wss://172.20.215.193:40004/log', // websocket信令服务URL
  // oamurl: 'https://172.20.215.193:40004', // 管理服务URL
  // stunurl: 'stun:172.20.215.193:40001' // stun服务器地址

  // websocketurl: 'wss://10.0.0.125:2237/log', // websocket信令服务URL
  // oamurl: 'https://10.0.0.125:2237', // 管理服务URL
  // stunurl: 'stun:10.0.0.125:2231' // stun服务器地址

  websocketurl: 'wss://' + host + '/log', // websocket信令服务URL
  oamurl: 'https://' + host, // 管理服务URL
  stunurl: 'stun:' + hostname + ':2331' // stun服务器地址

}

// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

Vue.config.productionTip = false

// 整合echarts
Vue.prototype.$echarts = echarts

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
